from interface.member import MemberInterface
from utils.get_keyword import GetKeyword
from utils.request_method import SendMethod
from utils.mysql_tools import DBtools


class GeneOrder:

    def __init__(self,headers):
        self.url='http://47.108.206.100:8085'
        self.headers = headers # 获取登录的用户令牌

        # 根据购物车生成订单
    def generate_order(self,cart_id):
        method = 'post'
        url = self.url + '/order/generateOrder'
        params = {
            "cartIds": [
              cart_id
            ],
            "memberReceiveAddressId": 3026,
            "payType": 0
        }
        return SendMethod.send_method(method, url, json=params, headers=self.headers)



